import fetchRequest  from'@/util/fetch'
//技师的所有订单
export const allWorkerMeiYeOrder = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/all',
        method: 'get',
        params: params
    })
}

export const listWorkerMeiYeOrder = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/list',
        method: 'get',
        params: params
    })
}

//技师排班
export const getByTimeScheduleMeiYeWorker = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/schedule/getByTime',
        method: 'get',
        params: params
    })
}
export const updateScheduleMeiYeWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/schedule/update',
        method: 'post',
        data: data
    })
}
export const oneKeyUpdateScheduleMeiYeWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/schedule/update/oneKey',
        method: 'post',
        data: data
    })
}

//是否技师
export const isWorkerMeiYeWorker = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/isWorker',
        method: 'get',
        params: params,
    })
}
//刷新位置（string）longitude（ string）latitude
export const refreshLocation = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/refreshLocation',
        method: 'get',
        params: params,
    })
}
//技师入驻情况,返回的数据为空, 说明没有申请入驻过。如果有数据,只会返回入驻成功,及入驻申请中的数据
export const settleDetailWorker = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/settle/detail',
        method: 'get',
        params: params,
    })
}
//技师申请入驻
export const settleMeiYeWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/settle',
        method: 'post',
        data: data,
    })
}

//订单详情
export const detailMeiYeOrder = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/detail',
        method: 'get',
        params: params
    })
}
//接受订单
export const acceptOrder = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/acceptOrder',
        method: 'post',
        data: data,
    })
}
//出发
export const outOrderWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/outOrder ',
        method: 'post',
        data: data,
    })
}
//订单操作: 技师到达指定位置
export const reachOrder = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/reachOrder',
        method: 'post',
        data: data,
    })
}
//技师开始服务
export const startOrderWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/startOrder',
        method: 'post',
        data: data
    })
}
//技师结束服务
export const endOrderWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/endOrder',
        method: 'post',
        data: data
    })
}
//技师统计
export const statisticWorkerMeiYeOrder = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/statistic',
        method: 'get',
        params:params
    })
}


//技师主页数据
export const myMeiYeWorker = (params={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/my',
        method: 'get',
        params:params
    })
}

export const withdrawalApplyMeiYeWorker = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeWorker/withdrawalApply',
        method: 'post',
        data: data
    })
}
export const withdrawalListMeiYeWorker = (params={}) => {
	return fetchRequest({
		url: '/blade-meiye/api/meiYeWorker/withdrawalList',
		method: 'get',
		params: params
	})
}
//
export const incomeListWorker = (params={}) => {
	return fetchRequest({
		url: '/blade-meiye/api/meiYeOrder/worker/incomeList',
		method: 'get',
		params: params
	})
}

//获取客户电话
export const phoneWorkerMeiYeOrder = (data={}) => {
    return fetchRequest({
        url: '/blade-meiye/api/meiYeOrder/worker/phone',
        method: 'post', 
        data: data,
    })
}
//技师上班开关
export const changeWantWork = (params={}) => {
    return fetchRequest({
        url:  '/blade-meiye/api/meiYeWorker/changeWantWork',
        method: 'post', 
        params: params,
    })
}
//查看技师上班状态
export const wantWork = (params={}) => {
    return fetchRequest({
        url:  '/blade-meiye/api/meiYeWorker/wantWork',
        method: 'get', 
        params: params,
    })
}
//获取客户号码（包含中间号）
export const midPhone = (data={}) => {
    return fetchRequest({
        url:  '/blade-meiye/api/meiYeOrder/worker/midPhone',
        method: 'post', 
        data: data,
    })
}
//获取当前技师位置
export const  getLocationMeiYeWorker= (params={}) => {
    return fetchRequest({
        url:  '/blade-meiye/api/meiYeWorker/getLocation',
        method: 'get', 
        params: params,
    })
}
//技师收支明细
export const billMeiYeWorker = (params={}) => {
    return fetchRequest({
        url:'/blade-meiye/api/meiYeWorker/bill',
        method: 'get', 
        params: params,
    })
}
//技师收支明细统计
export const statisticsMeiYeWorker = (params={}) => {
    return fetchRequest({
        url:'/blade-meiye/api/meiYeWorker/bill/statistics',
        method: 'get', 
        params: params,
    })
}

